/*    */ package system.staros.sblock1;
/*    */ 
/*    */ public class IfNode extends Node
/*    */ {
/*    */   private Node testCondition;
/*    */   private Node thenBlock;
/*    */   private Node elseBlock;
/*    */ 
/*    */   public IfNode(SourcePosition paramSourcePosition, Node paramNode1, Node paramNode2, Node paramNode3)
/*    */   {
/* 36 */     super(paramSourcePosition);
/* 37 */     this.testCondition = paramNode1;
/* 38 */     this.thenBlock = paramNode2;
/* 39 */     this.elseBlock = paramNode3;
/*    */   }
/*    */ 
/*    */   public Node getTestCondition() {
/* 43 */     return this.testCondition;
/*    */   }
/*    */ 
/*    */   public Node getThenBlock() {
/* 47 */     return this.thenBlock;
/*    */   }
/*    */ 
/*    */   public Node getElseBlock() {
/* 51 */     return this.elseBlock;
/*    */   }
/*    */ 
/*    */   public ZemObject eval(Interpreter paramInterpreter)
/*    */   {
/* 56 */     boolean bool = this.testCondition.eval(paramInterpreter).toBoolean(this.testCondition.getPosition()).booleanValue();
/* 57 */     if (bool)
/* 58 */       return this.thenBlock.eval(paramInterpreter);
/* 59 */     if (this.elseBlock != null) {
/* 60 */       return this.elseBlock.eval(paramInterpreter);
/*    */     }
/* 62 */     return ZemBoolean.FALSE;
/*    */   }
/*    */ 
/*    */   public String toString()
/*    */   {
/* 67 */     StringBuilder localStringBuilder = new StringBuilder();
/* 68 */     localStringBuilder.append('(');
/* 69 */     localStringBuilder.append("if ");
/* 70 */     localStringBuilder.append(this.testCondition);
/* 71 */     localStringBuilder.append(' ');
/* 72 */     localStringBuilder.append(this.thenBlock);
/* 73 */     if (this.elseBlock != null) {
/* 74 */       localStringBuilder.append(' ');
/* 75 */       localStringBuilder.append(this.elseBlock);
/*    */     }
/* 77 */     localStringBuilder.append(')');
/* 78 */     return localStringBuilder.toString();
/*    */   }
/*    */ }

/* Location:           D:\Марк\!IMPORTANT\staros\archive\version-2.260.zip
 * Qualified Name:     system.staros.sblock1.IfNode
 * JD-Core Version:    0.6.1
 */